package com.jctrip.hotel.source.model.elong;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @Author: zxy
 * @CreateTime: 2023-08-21 17:29
 * @Description:
 */
@Getter
public enum ElongLocalEnum {
    US("en_US", "英文"),
    CN("zh_CN","中文"),
    JSON("json", "Json"),
    ALL("ALl","全部"),
    SELF_PAY("SelfPay","前台现付"),
    PREPAY("Prepay","预付"),
    NO_SENSE("NoSense","全部"),
    ELONG("Elong","艺龙开票"),
    HOTEL("Hotel","酒店开票"),
    STATIC_CITY("hotel.static.city","静态城市数据"),
    STATIC_LIST("hotel.static.list","静态酒店列表"),
    STATIC_INFO("hotel.static.info","静态酒店详情"),
    DATA_RP("hotel.data.rp","产品详情"),
    INCR_ID("hotel.incr.id","增量编号"),
    INCR_SHARDING_ID("hotel.incr.sharding.id","分片增量编号"),
    INCR_SHARDING_STATE("hotel.incr.sharding.state","分片状态增量"),
    DATA_INVENTORY("hotel.data.inventory","房态库存"),
    INCR_INV("hotel.incr.inv","库存增量"),
    DATA_RATE("hotel.data.rate","产品价格"),
    INCR_RATE("hotel.incr.rate","价格增量"),
    DATA_VALIDATE("hotel.data.validate","数据验证"),
    ORDER_CREATE("hotel.order.create","创建订单"),
    ORDER_PAY("hotel.order.pay","订单支付"),
    INCR_ORDER("hotel.incr.order" ,"订单增量"),
    ORDER_DETAIL("hotel.order.detail","订单详情"),
    ORDER_CANCEL("hotel.order.cancel","取消订单"),
    INVENTORY("Inventory","库存变化"),
    RATE("Rate","价格变化"),
    ORDER("Order","订单变化"),
    DATA("Data","库存价格变化"),
    STATE("State","状态变化"),
    NOTALLOWEDCONFIRM("NotAllowedConfirm","不发送确认短信"),
    HOTEL_DETAIL("hotel.detail","酒店详情搜索")
    ;

    private final String code;
    private final String msg;

    ElongLocalEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static ElongLocalEnum getByCode(String code) {
        if (StringUtils.isBlank(code)) {
            return null;
        }
        for (ElongLocalEnum item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
}
